import {
	post
} from './axios.js';
import store from '../store.js';
//获取经验分享列表
function getstudyworkslist(p_data, callback) {
	let data = {
		"Token": store.getters.getToken,
		"PageIndex": p_data.PageIndex,
		"PageSize": 20,
		"IsShowAll": p_data.IsShowAll,
	};
	post('/content/getstudyworkslist', data, callback)
}
//读取我的学习作品详情
function getStudyworksInfo(p_data, callback) {
	let data = {
		"Token": store.getters.getToken,
		"Id": p_data.Id,
	};
	post('/content/getstudyworksinfo', data, callback)
}
//保存我的学习作品详情
function saveStudyworksInfo(p_data, callback) {
	let data = {
		...p_data,
		"Token": store.getters.getToken,
	};
	post('/content/savestudyworksinfo', data, callback)
}
//删除我的作品
function delStudyworksInfo(p_data, callback) {
	let data = {
		"Token": store.getters.getToken,
		"Id": p_data.Id,
	};
	post('/content/delstudyworksinfo', data, callback)
}

//取消收藏
function deluserfavorite(p_data, callback) {
	let data = {
		"Token": store.getters.getToken,
		"Id": p_data.Id,
	};
	post('/user/deluserfavorite', data, callback)
}
//收藏
function adduserfavorite(p_data, callback) {
	let data = {
		"Token": store.getters.getToken,
		"Id": p_data.Id,
	};
	post('/user/adduserfavorite', data, callback)
}
export default {
	getstudyworkslist: getstudyworkslist,
	getStudyworksInfo: getStudyworksInfo,
	saveStudyworksInfo: saveStudyworksInfo,
	delStudyworksInfo: delStudyworksInfo,
	deluserfavorite: deluserfavorite,
	adduserfavorite: adduserfavorite,
}
